<template>
    <div class="audit_detail">
        <div class="content_panel">
            <div class="panel_list">
                <current-order-info>当前订单明细</current-order-info>
                <personal-info>个人信息</personal-info>
                <his-repay-record>该订单还款记录</his-repay-record>
            </div>
            <h2 style="line-height: 40px; padding-top: 20px;"><i class="el-icon-menu"><b> 该订单催收记录</b></i></h2>
            <div class="placeholder" style="height: 420px;">
                <div class="tables">
                    <ul class="tabs">
                        <li><a @click="tabName = 'urgingRecordsS1'" :class="{'active': tabName === 'urgingRecordsS1'}"
                               href="javascript:void(0);">{{ $t('collection.S1ColRecord') }}<i class="detail_menu_icon el-icon-caret-top"></i></a>
                        </li>
                        <li><a @click="tabName = 'urgingRecordsS2'" :class="{'active': tabName === 'urgingRecordsS2'}"
                               href="javascript:void(0);">{{ $t('collection.S2ColRecord') }}<i class="detail_menu_icon el-icon-caret-top"></i></a>
                        </li>
                        <li><a @click="tabName = 'urgingRecordsS3'" :class="{'active': tabName === 'urgingRecordsS3'}"
                               href="javascript:void(0);">{{ $t('collection.S3ColRecord') }}<i class="detail_menu_icon el-icon-caret-top"></i></a>
                        </li>
                        <li><a @click="tabName = 'urgingRecordsM2'" :class="{'active': tabName === 'urgingRecordsM2'}"
                               href="javascript:void(0);">{{ $t('collection.M2ColRecord') }}<i class="detail_menu_icon el-icon-caret-top"></i></a>
                        </li>
                        <li><a @click="tabName = 'urgingRecordsM3'" :class="{'active': tabName === 'urgingRecordsM3'}"
                               href="javascript:void(0);">{{ $t('collection.M3ColRecord') }}<i class="detail_menu_icon el-icon-caret-top"></i></a>
                        </li>
                        <li><a @click="tabName = 'urgingRecordsM4'" :class="{'active': tabName === 'urgingRecordsM4'}"
                               href="javascript:void(0);">{{ $t('collection.M3PlusColRecord') }}<i class="detail_menu_icon el-icon-caret-top"></i></a>
                        </li>
                        <li><a @click="tabName = 'urgingRecordsM5'" :class="{'active': tabName === 'urgingRecordsM5'}"
                               href="javascript:void(0);">{{ $t('collection.preCollection') }}<i class="detail_menu_icon el-icon-caret-top"></i></a></li>
                    </ul>
                    <div class="table_panel">
                        <urging-records-s1 :update-type="updateTableType" @updateOver="updateTable('')"
                                           v-show="tabName === 'urgingRecordsS1'">S1催收记录
                        </urging-records-s1>
                        <urging-records-s2 :update-type="updateTableType" @updateOver="updateTable('')"
                                           v-show="tabName === 'urgingRecordsS2'">S2催收记录
                        </urging-records-s2>
                        <urging-records-s3 :update-type="updateTableType" @updateOver="updateTable('')"
                                           v-show="tabName === 'urgingRecordsS3'">S3催收记录
                        </urging-records-s3>
                        <urging-records-m2 :update-type="updateTableType" @updateOver="updateTable('')"
                                           v-show="tabName === 'urgingRecordsM2'">M2催收记录
                        </urging-records-m2>
                        <urging-records-m3 :update-type="updateTableType" @updateOver="updateTable('')"
                                           v-show="tabName === 'urgingRecordsM3'">M3催收记录
                        </urging-records-m3>
                        <urging-records-m4 :update-type="updateTableType" @updateOver="updateTable('')"
                                           v-show="tabName === 'urgingRecordsM4'">M3+催收记录
                        </urging-records-m4>
                        <urging-records-m5 :update-type="updateTableType" @updateOver="updateTable('')"
                                           v-show="tabName === 'urgingRecordsM5'">预催收
                        </urging-records-m5>
                    </div>
                </div>
            </div>
        </div>
        <div class="operation_panel" v-if="repayStatus === '0' && user.username !== 'dlxhcs'">
            <operation-panel :user-data="data.telRecordPanel" :show-panel="showPanel" @updateTable="updateTable">
                催记面板
            </operation-panel>
        </div>
    </div>
</template>

<script>
    import currentOrderInfo from './current-order-info'
    import personalInfo from './personal-info';
    import hisRepayRecord from './his-repay-record';
    import operationPanel from './operation-panel';
    import urgingRecordsS1 from './urging-records-s1';
    import urgingRecordsS2 from './urging-records-s2';
    import urgingRecordsS3 from './urging-records-s3';
    import urgingRecordsM2 from './urging-records-m2';
    import urgingRecordsM3 from './urging-records-m3';
    import urgingRecordsM4 from './urging-records-m4';
    import urgingRecordsM5 from './urging-records-m5';

    export default {
        name: 'collection-preOrderManage-orderDetail',
        props: {
            showPanel: {
                type: Boolean,
                default: true
            }
        },
        components: {
            currentOrderInfo,
            personalInfo,
            hisRepayRecord,
            operationPanel,
            urgingRecordsS1,
            urgingRecordsS2,
            urgingRecordsS3,
            urgingRecordsM2,
            urgingRecordsM3,
            urgingRecordsM4,
            urgingRecordsM5,
        },
        data() {
            return {
                showMenu: false,
                updateTableType: '',
                hideTables: false, // 隐藏表格
                showTables: false,
                tabName: 'urgingRecordsS1',
                data: {
                    telRecordPanel: {
                        phone: '',
                    }
                },
                repayStatus: this.$route.params.repayStatus,
                user: this.$storage.get('user'),
            };
        },
        methods: {
            updateTable(val) {
                this.updateTableType = val;
            }
        },
        created() {
            let query = this.$route.query;
            if (this.$route.params.repayStatus) {
                this.repayStatus = this.$route.params.repayStatus;
            }
        }
    };
</script>

<style lang="scss">
    @import '~@/assets/scss/function';
    [data-page=collection-preOrderManage-orderDetail] {
        .left_menu {
            display: none;
        }
        .row.el-row {
            padding-top: 10px;
            padding-left: 30px;
        }
        .callDetail .el-row {
            font-size: 16px;
            padding-top: 10px;
        }
        .el-tooltip__popper {
            max-width: 300px;
            word-break: break-all;
            background-color: #fff;
            box-shadow: 0px 0px 5px #ccc;
            color: #000;
        }
        .telPagination {
            padding-bottom: 20px;
            float: right;
        }
        .opacity_panel {
            opacity: 0.7;
        }
        /*.detail_module_panel {*/
        /*padding: 0 12px;*/
        /*}*/
        .detail_panel_title {
            padding-left: 32px;
            margin: 0;
            font-size: 14px;
            height: 52px;
            line-height: 52px;
            /*  border-bottom: 1px solid $colorSplit;*/
        }
        .panel_info_content {
            padding: 20px 0;
            .row {
                margin-bottom: 12px;
                &:last-child {
                    margin-bottom: 0;
                }
            }
            .label {
                color: #a6a8aa;
                font-size: 12px;
                text-align: right;
                padding: 0 8px;
            }
            .info {
                font-size: 12px;
                padding: 0 8px;
            }
        }
        .el-select {
            width: 100%;
        }
        .el-form-item__label {
            font-size: 12px;
            line-height: 17px;
            color: #a6a8aa;
            padding-bottom: 8px;
        }
        .el-form-item {
            margin-bottom: 25px;
        }
        .el-button--mini {
            padding: 5px 10px;
        }
        .info.contact.el-col.el-col-16 {
            text-align: center;
        }
        .el-form-item__content {
            line-height: 23px;
        }
        .tables {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            /*background-color: #47c5b2;*/
            /*#F0F4F5*/
            height: 500px;
        }
        .tabs {
            background-color: #47c5b2;
            position: relative;
            li {
                display: inline-block;
                a {
                    color: rgba(255, 255, 255, 0.6);
                    display: block;
                    padding: 0 24px;
                    height: 44px;
                    line-height: 44px;
                    position: relative;
                    &.active {
                        color: #fff;
                        .detail_menu_icon {
                            display: block;
                        }
                    }
                    .detail_menu_icon {
                        display: none;
                        position: absolute;
                        bottom: -7px;
                        left: 50%;
                        transform: translateX(-50%);
                        font-size: 20px;
                        color: #f4f5f6;
                    }
                }
            }
            .detail_tables_icon, .hide_tables_icon {
                position: absolute;
                top: 0;
                right: 0;
                height: 44px;
                line-height: 44px;
                width: 56px;
                color: #fff;
                font-size: 25px;
                cursor: pointer;
                text-align: center;
                &.rotate {
                    transform: rotate(180deg);
                }
            }
            .hide_tables_icon {
                right: 70px;
            }
        }
        .imgs {
            li {
                display: inline-block;
                width: 200px;
                margin-right: 24px;
                border: 1px solid $colorSplit;
                border-radius: 8px;
                overflow: hidden;
                a {
                    display: block;
                    height: 112px;
                    width: 100%;
                    background-color: #e5e5e5;
                    background-repeat: no-repeat;
                    background-position: center center;
                    background-size: cover;
                }
                .img_desc {
                    height: 32px;
                    line-height: 32px;
                    padding: 0 16px;
                }
            }
        }
    }
</style>
<style lang="scss" scoped>


    .audit_detail {
        display: flex;
        height: 100%;
        width: 100%;
    }

    .content_panel {
        flex: 1;
        padding: 16px 16px 0;
        display: flex;
        flex-direction: column;
        position: relative;
        overflow: hidden;
    }

    .operation_panel {
        width: 350px;
        background-color: #fff;
        /*padding: 16px;*/
        overflow: auto;
        box-shadow: -1px 0 4px 0 rgba(0, 0, 0, 0.05);
    }

    .panel_list {
        background-color: #fff;
        flex: 1;
        overflow: auto;
    }

    .placeholder {
        height: 212px;
        position: relative;
        /*margin: 0 -16px 0;*/
        overflow: visible;
    }
</style>
